<template>
	<view>
		<u-action-sheet :list="list" :tips="{text:$t('客服电话')}" v-model="sheetShow" :mask-close-able="false"
			@click="clickItem" @close="close"></u-action-sheet>
	</view>
</template>

<script>
	// 客服电话
	export default {
		name: "SeekPhone",
		data() {
			return {
				list: [],
				sheetShow: false
			}
		},
		props: {
			show: {
				type: Boolean,
				default: false
			},
		},
		methods: {
			clickItem(e) {
				const phone = this.list[e].text;
				uni.makePhoneCall({
					phoneNumber: phone
				})
				this.close()
			},
			close() {
				this.sheetShow = false;
				this.$emit("close", false)
			}
		},
		watch: {
			show: {
				immediate: true,
				handler(n, o) {
					this.sheetShow = n;
					if (n) {
						const lang = uni.getStorageSync('lang')
						console.log("语言 lang", lang);
						this.$u.api.user.appCheck({lang:lang}).then(res => {
							console.log(res)
							if(lang==='ru'){
								this.list = res.ru_text
								
							}else{
								this.list = res.zh_text
								
							}
						})
						// 俄文
						// if (lang === 'ru') {
						// 	this.list = [{
						// 			text: "89149881777"
						// 		},
						// 		{
						// 			text: "89834252777"
						// 		}
						// 	]
						// } else {
						// 	this.list = [{
						// 		text: ""
						// 	}]
						// }
					}
				}
			}
		},
		mounted() {
			
		}
	}
</script>

<style lang="scss" scoped>
</style>